package com.iamteer.c_type;

import java.util.Date;

import com.opensymphony.xwork2.ActionSupport;
/**
 * Struts 核心业务：请求数据自动封装及类型转换
 * @author Chuck
 *
 */
public class UserAction extends ActionSupport {
/*	
	private String name;	// 必须给 Setter
	private String pwd;
	private int age;
	private Date birth;
	
	public void setName(String name) {
		this.name = name;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public void setAge(int age) {
		this.age = age;
	}
	public void setBirth(Date birth) {
		this.birth = birth;
	}
*/
	
	private User user;	// 设置上 Setter 与 Getter
	public void setUser(User user) {
		this.user = user;
	}
	public User getUser() {
		return user;
	}
	
	public String register() {
		System.out.println(user.getName());
		System.out.println(user.getPwd());
		System.out.println(user.getAge());
		System.out.println(user.getBirth());
		
		return SUCCESS;
	}
}
